﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Coffee Pot Client");
            try
            {
                if (args.Length == 1) new HTCPCPClient(new ClientRequest(args[0])); //no port given
                else if (args.Length == 2) new HTCPCPClient(new ClientRequest(args[0]), args[1]); // port given
                else Console.WriteLine("Usage <URL>\n\t<URL> <Port>");
            }
            catch (ClientException cEx)
            {
                Console.WriteLine("Response error.\n" + cEx.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("General error.\n" + ex.Message);
            }
            Console.ReadLine();
        }
    }
}
